package com.abel.order.state.controller;

import com.abel.order.state.entity.Order;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 状态模式测试
 *
 * @author heyangyang
 * @since 2024-04-26
 */
@RequestMapping("/")
@RestController
public class StateController {

    @GetMapping("/state")
    public String state() {
        Order order = new Order();
        System.out.println(order.getOrderStateEnum());
        order.nextState();
        System.out.println(order.getOrderStateEnum());
        order.nextState();
        System.out.println(order.getOrderStateEnum());
        order.nextState();
        return "success";
    }

}
